﻿@model EasyErp.ViewModel.StyleOperationViewModel

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Style</legend>

        @Html.HiddenFor(model => model.Style.StyleId)

         <div class="editor-label">
            @Html.LabelFor(model => model.Style.StyleNo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Style.StyleNo)
            @Html.ValidationMessageFor(model => model.Style.StyleNo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Style.StyleDescription)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Style.StyleDescription)
            @Html.ValidationMessageFor(model => model.Style.StyleDescription)
        </div>

        <div>
            @for (int i = 0; i < Model.OperationList.Count; i++)
            { 
                @Html.HiddenFor(model => model.OperationList[i].StyleOperationId)
                <br />
                
                @Html.HiddenFor(model => model.OperationList[i].OperationId)
                @Html.HiddenFor(model => model.OperationList[i].OperationDesc)
                
                @Html.CheckBoxFor(model => model.OperationList[i].IsCheecked)
                @Html.LabelFor(model => model.OperationList[i].OperationDesc, Model.OperationList[i].OperationDesc)                
            }
        </div>

        <p>
            <input type="submit" value="Update" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
